package com.zkadmin.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class DateTimeUtils {
	public static String FMT_LONG_TIME = "yyy-MM-dd HH:mm:ss";
	public static String FMT_DATE = "yyy-MM-dd";
	public static String FMT_TIME = "HH:mm:ss";

	public static String fmt(Date date) {
		return fmt(date, FMT_LONG_TIME);
	}

	public static String fmt(Date date, String fmt) {
		if (date == null) {
			return "";
		}
		return new SimpleDateFormat(fmt).format(date);
	}
}
